﻿using BW.Rabbit.Domain;
using BW.Rabbit.ErrorCode;
using BW.Rabbit.Infrasttucture.Interfaces;
using BW.Rabbit.Write.API.Applications.Commands;
using MediatR;

namespace BW.Rabbit.Write.API.Applications.CommandHandlers
{
    /// <summary>
    /// 爱吃兔新增命令处理
    /// </summary>
    public class RabbitCreateCommandHandlers : IRequestHandler<RabbitCreateCommand, APIResult<object>>
    {
        /// <summary>
        /// 商品信息仓储
        /// </summary>
        IBaseRepository<GoodsInfo> goodsinfoRepository;
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="goodsinfoRepository">商品信息仓储</param>
        public RabbitCreateCommandHandlers(IBaseRepository<GoodsInfo> goodsinfoRepository)
        {
        }
        public Task<APIResult<object>> Handle(RabbitCreateCommand request, CancellationToken cancellationToken)
        {
            APIResult<object> result = new APIResult<object>();
            result.Code = EnumCode.添加成功;
            result.Msg = EnumCode.添加成功.ToString();
            

            return Task.FromResult(result);
        }
    }
}
